/**
 * 
 */
package com.qhgrain.app.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qhgrain.app.service.AgentService;

/**
 * 代理4A或封装IAM接口控制器
 * @author Administrator
 *
 */

@Controller
@RequestMapping("/iam")
public class AgentController {
	
	private static Logger LOG = LoggerFactory.getLogger(AgentController.class);
	
	@Autowired
	private AgentService agentService;
	
	 /**
     * 
     * 获取直属单位
     * @param 
     * @return 
     * @author Administrator
     * @date 2016年6月14日
     */
	@RequestMapping(value="/unit/getDirectUnitByUuid/{uuid}",produces="text/html;charset=UTF-8")
    @ResponseBody
    public String getDirectUnitByUuid(@PathVariable String uuid) throws Exception{
       return agentService.getDirectUnitByUuid(uuid);
    }    
    /**
     * 
     * 获取涉粮企业
     * @param 
     * @return 
     * @author Administrator
     * @date 2016年6月14日
     */
	@RequestMapping(value="/unit/getGrainUnitByUuid/{uuid}",produces="text/html;charset=UTF-8")
    @ResponseBody
    public String getGrainUnitByUuid(@PathVariable String uuid) throws Exception{
        return agentService.getGrainUnitByUuid(uuid);
    }
	
	

}
